Inside Macintosh: QuickTime Components

| Previous | Chapter contents | Chapter top | Section top | Next |

Exporting Movie Data

Movie data export components may provide one or two functions that allow the Movie Toolbox to request a data conversion operation. The MovieExportToHandle function instructs your component to place the converted data into a specified handle. The MovieExportToFile function instructs you to put the data into a file. You should set the appropriate flags in your component's componentFlags field to indicate which of these functions your component supports. Note that your component may support both functions.

Before the Movie Toolbox calls one of these functions, a requesting application may call one or more of your component's configuration functions (see "Configuring Movie Data Export Components" for more information about these functions). However, your component should work properly even if none of these configuration functions is called.

MovieExportToHandle

The MovieExportToHandle function allows the Movie Toolbox to export data from a movie, using your movie data export component.

pascal ComponentResult MovieExportToHandle
                                         (MovieImportComponent ci,
           &nsp;                              Handle dataH, Movie theMovie,
                                          Track onlyThisTrack,
                                          TimeValue startTime,
                                          TimeValue duration);
ci
Identifies the Movie Toolbox's connection to your movie data export component.

dataH
Handle to be filled with the converted movie data. Your component must write data into this handle that corresponds to your component's subtype value.

Your component should resize this handle as appropriate.

theMovie
Identifies the movie for this operation. This movie identifier is supplied by the Movie Toolbox. Your component may use this identifier to obtain sample data from the movie or to obtain information about the movie.

onlyThisTrack
Identifies a track that is to be converted. This track identifier is supplied by the Movie Toolbox. If this parameter contains a track identifier, your component must convert only the specified track.

startTime
Specifies the starting point of the track or movie segment to be converted. This time value is expressed in the movie's time coordinate system.

duration
Specifies the duration of the track or movie segment to be converted. This duration value is expressed in the movie's time coordinate system.

DESCRIPTION

The Movie Toolbox calls the MovieExportToHandle function in order to export movie data into a handle. Your component must read the data from the specified movie or track, perform appropriate conversions on that data, and place the data into the handle. The data stored in the handle must have a data type that corresponds to the component subtype of your movie data export component.

If your component can write data to a handle, be sure to set the canMovieExportHandles flag in your component's componentFlags field.

Your component must be prepared to perform this function at any time. You should not expect that any of your component's configuration functions will be called first.

RESULT CODES

invalidTrack

-2009

Specified track cannot be converted

Other appropriate Movie Toolbox result codes

SEE ALSO

The Movie Toolbox uses the MovieExportToFile function to export data to a file; this function is described next.

MovieExportToFile

The MovieExportToFile function allows the Movie Toolbox to export data to a file, using your movie data export component.

pascal ComponentResult MovieExportToFile (MovieImportComponent ci,
                                          const FSSpec *theFile,
                                          Movie theMovie,
                                          Track onlyThisTrack,
                                          TimeValue startTime,
                                          TimeValue duration);
ci
Identifies the Movie Toolbox's connection to your movie data import component.

theFile
Contains a pointer to the file that is to receive the converted movie data. This file's type value corresponds to your component's subtype value.

theMovie
Identifies the movie for this operation. This movie identifier is supplied by the Movie Toolbox. Your component may use this identifier to obtain sample data from the movie or to obtain information about the movie.

onlyThisTrack
Identifies a track that is to be converted. This track identifier is supplied by the Movie Toolbox. If this parameter contains a track identifier, your component must convert only the specified track.

startTime
Specifies the starting point of the track or movie segment to be converted. This time value is expressed in the movie's time coordinate system.

duration
Specifies the duration of the track or movie segment to be converted. This duration value is expressed in the movie's time coordinate system.

DESCRIPTION

The Movie Toolbox calls the MovieExportToFile function in order to export movie data into a file. Your component must read the data from the track or movie, perform appropriate conversions on that data, and place the data into the specified file. The file's type corresponds to the component subtype of your movie data export component.

Note that the requesting program or toolbox must create the destination file before calling this function. Furthermore, your component may not destroy any data in the destination file. If you cannot add data to the specified file, return an appropriate error.

If your component can write data to a file, be sure to set the canMovieExportFiles flag in your component's componentFlags field.

Your component must be prepared to perform this function at any time. You should not expect that any of your component's configuration functions will be called first.

RESULT CODES

invalidTrack

-2009

Specified track cannot be converted

Other appropriate Movie Toolbox result codes

SEE ALSO

The Movie Toolbox uses the MovieExportToHandle function to export data to a file; this function is described in the previous section.


© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |